<?php

namespace app\api\validate;

use think\Validate;

class Login extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'js_code' => 'require',
        'iv' => 'require',
        'encryptedData' => 'require',
        'openid' => 'require',
        'code' => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'js_code.require' => '缺少微信code',
        'iv.require' => '缺少iv',
        'encryptedData.require' => '缺少encryptedData',
        'openid.require' => '缺少openid',
        'code.require' => '缺少code',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'weChatLogin' => ['js_code', 'iv', 'encryptedData'],
        'bindMobile' => ['code', 'openid'],
    ];
}